<?php

namespace app\api\controller;

use app\common\controller\Api;
use app\common\library\Ems;
use app\common\library\Sms;
use app\common\model\mycurrency\Device;
use fast\Random;
use Psr\Log\NullLogger;
use think\Config;
use think\Validate;

/**
 * 定时任务接口
 */
class Task extends Api
{
    protected $noNeedLogin = [];
    protected $noNeedRight = '*';

    public function _initialize()
    {
        //parent::_initialize();
    }
    public function deviceOffline(){
        $time = time() - 120;
        $data = Device::where([
            'is_online' => Device::IS_ONLINE_ZAIXIAN,
            'deletetime' => null,
            'heartbeat_time' => ['<',$time]
        ])->update([
            'is_online' => Device::IS_ONLINE_BUZAIXIAN,
        ]);
    }
}
